//
//  EnsureViewController.m
//  NewProject
//
//  Created by admin on 2017/6/21.
//  Copyright © 2017年 李航飞. All rights reserved.
//

#import "EnsureViewController.h"
//#import "EnsureTableViewCell.h"
//#import "ImageTableViewCell.h"
@interface EnsureViewController ()<UITableViewDelegate,UITableViewDataSource>
//@property(nonatomic, strong)UIView *headView;
//@property(nonatomic, strong)UITableView *tableView;
@property(nonatomic, strong)UIScrollView *scrollView;
//@property(nonatomic, strong)NSArray *dataArray;
@end

@implementation EnsureViewController
//- (NSArray *)dataArray{
//    if (!_dataArray) {
//        _dataArray = [NSArray array];
//    }
//    return _dataArray;
//}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"确认订单";
//    self.dataArray = @[@{kTitle:@"",kContent:@""},@{kTitle:@"橙子社区精选",kContent:@""},@{kTitle:@"",kContent:@""},@{kTitle:@"",kContent:@"合计:¥26.7"},@{kTitle:@"",kContent:@""},@{kTitle:@"在线支付",kContent:@""},@{kTitle:@"货到付款",kContent:@""},@{kTitle:@"",kContent:@""},@{kTitle:@"优惠券",kContent:@"暂无可用"},@{kTitle:@"账户余额",kContent:@"暂无可用余额"},@{kTitle:@"",kContent:@""},@{kTitle:@"橙子社区精选",kContent:@""},@{kTitle:@"橙子社区精选",kContent:@""},@{kTitle:@"橙子社区精选",kContent:@""},@{kTitle:@"橙子社区精选",kContent:@""},@{kTitle:@"橙子社区精选",kContent:@""},@{kTitle:@"橙子社区精选",kContent:@""},@{kTitle:@"橙子社区精选",kContent:@""},];
    
    [self createHeadView];
//    [self createTableView];
    // Do any additional setup after loading the view.
}

- (void)createHeadView{
    _scrollView = [[UIScrollView alloc]init];
    _scrollView.frame = CGRectMake(0, 0, WIDTH, HIGHT-64);
    _scrollView.contentSize = CGSizeMake(WIDTH, 5700/WIDTH_6_SCALE);
    _scrollView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:_scrollView];
    
    UIImageView * bgImageView = [[UIImageView alloc]init];
    bgImageView.image = [UIImage imageNamed:@"栏"];
    [_scrollView addSubview:bgImageView];

    UIImageView * locationImageView= [[UIImageView alloc]init];
    locationImageView.image = [UIImage imageNamed:@"定位"];
    [_scrollView addSubview:locationImageView];
    
    UILabel *nameLabel = [[UILabel alloc]init];
    nameLabel.font = FONT(15);
    nameLabel.text = @"姓名       18900000000";
    nameLabel.textColor = RGB0X(0x5d5d5d);
    [_scrollView addSubview:nameLabel];
    
    UILabel *locationLabel = [[UILabel alloc]init];
    locationLabel.font = FONT(15);
    locationLabel.text = @"和泰大厦(西门)1108";
    locationLabel.textColor = RGB0X(0x5d5d5d);
    [_scrollView addSubview:locationLabel];
    
    UIImageView *boxImageView = [[UIImageView alloc]init];
    boxImageView.image = [UIImage imageNamed:@"盒"];
    [_scrollView addSubview:boxImageView];
    
    UILabel *tipLabel = [[UILabel alloc]init];
    tipLabel.text = @"20分钟内送达";
    tipLabel.font = FONT(13);
    tipLabel.textColor = RGB0X(0x0E0908);
    [_scrollView addSubview:tipLabel];
    
    UIView *section1 = [[UIView alloc]init];
    section1.backgroundColor = RGB0X(0xF8F9F6);
    [_scrollView addSubview:section1];
    
    [section1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(0);
        make.top.equalTo(bgImageView.mas_bottom).offset(46/WIDTH_6_SCALE);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 8/WIDTH_6_SCALE));
    }];

    UIView *row1 = [[UIView alloc]init];
    row1.backgroundColor = [UIColor whiteColor];
    [_scrollView addSubview:row1];
    
    UILabel *choiceLabel = [[UILabel alloc]init];
    choiceLabel.textColor = RGB0X(0x333333);
    choiceLabel.text = @"橙子社区精选";
    choiceLabel.font = FONT(15);
    [_scrollView addSubview:choiceLabel];
    
    UIView *line1 = [[UIView alloc]init];
    line1.backgroundColor = RGB0X(0xF8F9F6);
    [_scrollView addSubview:line1];
    
    [line1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left);
        make.bottom.equalTo(row1.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 0.5/WIDTH_6_SCALE));
    }];
    
    [choiceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(15/WIDTH_6_SCALE);
        make.centerY.equalTo(row1.mas_centerY);
    }];
    
    [row1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(0);
        make.top.equalTo(section1.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 46/WIDTH_6_SCALE));
    }];
    UIButton *row2 = [[UIButton alloc]init];
    row2.backgroundColor = [UIColor whiteColor];
    [row2 addTarget:self action:@selector(row2Click) forControlEvents:UIControlEventTouchUpInside];
    [_scrollView addSubview:row2];
    
    UIImageView *goodImageView = [[UIImageView alloc]init];
    goodImageView.image = [UIImage imageNamed:@"商品"];
    [row2 addSubview:goodImageView];
    
    UILabel *numLabel = [[UILabel alloc]init];
    numLabel.textColor = RGB0X(0x333333);
    numLabel.text = @"共4件";
    numLabel.font = FONT(13);
    [row2 addSubview:numLabel];
    
    UIImageView *rightImageView = [[UIImageView alloc]init];
    rightImageView.image = [UIImage imageNamed:@"箭头"];
    [row2 addSubview:rightImageView];
    
    UIView *line2 = [[UIView alloc]init];
    line2.backgroundColor = RGB0X(0xF8F9F6);
    [row2 addSubview:line2];
    
    [line2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left);
        make.bottom.equalTo(row2.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 0.5/WIDTH_6_SCALE));
    }];
    
    [numLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(rightImageView.mas_left).offset(-5/WIDTH_6_SCALE);
        make.centerY.equalTo(row2.mas_centerY);
    }];
    
    [rightImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.view.mas_right).offset(-15/WIDTH_6_SCALE);
        make.centerY.equalTo(row2.mas_centerY);
    }];
    
    [goodImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(15/WIDTH_6_SCALE);
        make.centerY.equalTo(row2.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(70/WIDTH_6_SCALE, 70/WIDTH_6_SCALE));
    }];
    
    [row2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(0);
        make.top.equalTo(row1.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 85/WIDTH_6_SCALE));
        
    }];

    UIView *row3 = [[UIView alloc]init];
    row3.backgroundColor = [UIColor whiteColor];
    [_scrollView addSubview:row3];
    
    UILabel *totalLabel = [[UILabel alloc]init];
    totalLabel.textColor = RGB0X(0xFF830F);
    totalLabel.text = @"合计:¥26.7";
    totalLabel.font = FONT(13);
    [_scrollView addSubview:totalLabel];
    
    [totalLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.view.mas_right).offset(-15/WIDTH_6_SCALE);
        make.centerY.equalTo(row3.mas_centerY);
    }];
    
    [row3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(0);
        make.top.equalTo(row2.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 46/WIDTH_6_SCALE));
    }];

    UIView *section2 = [[UIView alloc]init];
    section2.backgroundColor = RGB0X(0xF8F9F6);
    [_scrollView addSubview:section2];

    [section2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(0);
        make.top.equalTo(row3.mas_bottom).offset(0);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 8/WIDTH_6_SCALE));
    }];
    
    UIView *row4 = [[UIView alloc]init];
    row4.backgroundColor = [UIColor whiteColor];
    [_scrollView addSubview:row4];
    
    UILabel *onlineLabel = [[UILabel alloc]init];
    onlineLabel.textColor = RGB0X(0x333333);
    onlineLabel.text = @"在线支付";
    onlineLabel.font = FONT(13);
    [_scrollView addSubview:onlineLabel];
    
    UIButton * onlineButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [onlineButton setImage:[UIImage imageNamed:@"未选中"] forState:UIControlStateNormal];
    [onlineButton addTarget:self action:@selector(onlineButtonClick:) forControlEvents:UIControlEventTouchUpInside];
    [onlineButton setImage:[UIImage imageNamed:@"选中"] forState:UIControlStateSelected];
    onlineButton.tag = 999;
    [_scrollView addSubview:onlineButton];

    UIView *line3 = [[UIView alloc]init];
    line3.backgroundColor = RGB0X(0xF8F9F6);
    [row4 addSubview:line3];

    [line3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left);
        make.bottom.equalTo(row4.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 0.5/WIDTH_6_SCALE));
    }];

    [onlineButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.view.mas_right).offset(-13/WIDTH_6_SCALE);
        make.centerY.equalTo(row4.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(19/WIDTH_6_SCALE, 19/WIDTH_6_SCALE));
    }];

    [onlineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(15/WIDTH_6_SCALE);
        make.centerY.equalTo(row4.mas_centerY);
    }];
    
    [row4 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(0);
        make.top.equalTo(section2.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 46/WIDTH_6_SCALE));
    }];

    UIView *row5 = [[UIView alloc]init];
    row5.backgroundColor = [UIColor whiteColor];
    [_scrollView addSubview:row5];
    
    UILabel *offlineLabel = [[UILabel alloc]init];
    offlineLabel.textColor = RGB0X(0x333333);
    offlineLabel.text = @"货到付款";
    offlineLabel.font = FONT(13);
    [_scrollView addSubview:offlineLabel];
    
    UIButton * offlineButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [offlineButton setImage:[UIImage imageNamed:@"未选中"] forState:UIControlStateNormal];
    [offlineButton addTarget:self action:@selector(onlineButtonClick:) forControlEvents:UIControlEventTouchUpInside];
    [offlineButton setImage:[UIImage imageNamed:@"选中"] forState:UIControlStateSelected];
    offlineButton.tag = 1000;
    [_scrollView addSubview:offlineButton];
    
    [offlineButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.view.mas_right).offset(-13/WIDTH_6_SCALE);
        make.centerY.equalTo(row5.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(19/WIDTH_6_SCALE, 19/WIDTH_6_SCALE));
    }];
    
    [offlineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(15/WIDTH_6_SCALE);
        make.centerY.equalTo(row5.mas_centerY);
    }];
    
    [row5 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(0);
        make.top.equalTo(row4.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 46/WIDTH_6_SCALE));
    }];

    UIView *section3 = [[UIView alloc]init];
    section3.backgroundColor = RGB0X(0xF8F9F6);
    [_scrollView addSubview:section3];
    
    [section3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(0);
        make.top.equalTo(row5.mas_bottom).offset(0);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 8/WIDTH_6_SCALE));
    }];

    UIButton *row6 = [[UIButton alloc]init];
    row6.backgroundColor = [UIColor whiteColor];
    [row6 addTarget:self action:@selector(row6Click) forControlEvents:UIControlEventTouchUpInside];
    [_scrollView addSubview:row6];
    
    UILabel *couponLabel = [[UILabel alloc]init];
    couponLabel.textColor = RGB0X(0x333333);
    couponLabel.text = @"优惠券";
    couponLabel.font = FONT(13);
    [_scrollView addSubview:couponLabel];
    
    UILabel *couponNumLabel = [[UILabel alloc]init];
    couponNumLabel.textColor = RGB0X(0x737373);
    couponNumLabel.text = @"暂无可用";
    couponNumLabel.font = FONT(13);
    [_scrollView addSubview:couponNumLabel];

    UIImageView *rightImageView2 = [[UIImageView alloc]init];
    rightImageView2.image = [UIImage imageNamed:@"箭头"];
    [row6 addSubview:rightImageView2];
    
    UIView *line4 = [[UIView alloc]init];
    line4.backgroundColor = RGB0X(0xF8F9F6);
    [row6 addSubview:line4];
    
    [line4 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left);
        make.bottom.equalTo(row6.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 0.5/WIDTH_6_SCALE));
    }];
    
    [couponNumLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(rightImageView2.mas_right).offset(-12/WIDTH_6_SCALE);
        make.centerY.equalTo(row6.mas_centerY);
    }];
    
    [rightImageView2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.view.mas_right).offset(-15/WIDTH_6_SCALE);
        make.centerY.equalTo(row6.mas_centerY);
    }];

    [couponLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(15/WIDTH_6_SCALE);
        make.centerY.equalTo(row6.mas_centerY);
    }];
    
    [row6 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(0);
        make.top.equalTo(section3.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 46/WIDTH_6_SCALE));
    }];

    UIView *row7 = [[UIView alloc]init];
    row7.backgroundColor = [UIColor whiteColor];
    [_scrollView addSubview:row7];
    
    UILabel *yueLabel = [[UILabel alloc]init];
    yueLabel.textColor = RGB0X(0x333333);
    yueLabel.text = @"账户余额";
    yueLabel.font = FONT(13);
    [_scrollView addSubview:yueLabel];
    
    UILabel *yueNumLabel = [[UILabel alloc]init];
    yueNumLabel.textColor = RGB0X(0x737373);
    yueNumLabel.text = @"暂无可用余额";
    yueNumLabel.font = FONT(13);
    [_scrollView addSubview:yueNumLabel];
    
    [yueNumLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.view.mas_right).offset(-13/WIDTH_6_SCALE);
        make.centerY.equalTo(row7.mas_centerY);
    }];
    
    [yueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(15/WIDTH_6_SCALE);
        make.centerY.equalTo(row7.mas_centerY);
    }];
    
    [row7 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(0);
        make.top.equalTo(row6.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 46/WIDTH_6_SCALE));
    }];

    UIView *section4 = [[UIView alloc]init];
    section4.backgroundColor = RGB0X(0xF8F9F6);
    [_scrollView addSubview:section4];
    
    [section4 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(0);
        make.top.equalTo(row7.mas_bottom).offset(0);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 8/WIDTH_6_SCALE));
    }];

    UIButton *row8 = [[UIButton alloc]init];
    row8.backgroundColor = [UIColor whiteColor];
    [row8 addTarget:self action:@selector(row8Click) forControlEvents:UIControlEventTouchUpInside];
    [_scrollView addSubview:row8];
    
    UILabel *remarksLabel = [[UILabel alloc]init];
    remarksLabel.textColor = RGB0X(0x333333);
    remarksLabel.text = @"备注";
    remarksLabel.font = FONT(13);
    [_scrollView addSubview:remarksLabel];
    
    UILabel *contentLabel = [[UILabel alloc]init];
    contentLabel.textColor = RGB0X(0x333333);
    contentLabel.text = @"其他要求（如带一瓶水）";
    contentLabel.font = FONT(13);
    [_scrollView addSubview:contentLabel];
    
    UIImageView *rightImageView3 = [[UIImageView alloc]init];
    rightImageView3.image = [UIImage imageNamed:@"箭头"];
    [row8 addSubview:rightImageView3];
    
    UIView *line5 = [[UIView alloc]init];
    line5.backgroundColor = RGB0X(0xF8F9F6);
    [row8 addSubview:line5];
    
    [line5 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left);
        make.bottom.equalTo(row8.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 0.5/WIDTH_6_SCALE));
    }];
    
    [contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(rightImageView3.mas_right).offset(-12/WIDTH_6_SCALE);
        make.centerY.equalTo(row8.mas_centerY);
    }];
    
    [rightImageView3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.view.mas_right).offset(-15/WIDTH_6_SCALE);
        make.centerY.equalTo(row8.mas_centerY);
    }];
    
    [remarksLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(15/WIDTH_6_SCALE);
        make.centerY.equalTo(row8.mas_centerY);
    }];
    
    [row8 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(0);
        make.top.equalTo(section4.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 46/WIDTH_6_SCALE));
    }];

    UIView *row9 = [[UIButton alloc]init];
    row9.backgroundColor = [UIColor whiteColor];
    [_scrollView addSubview:row9];
    
    UILabel *titleLabel1 = [[UILabel alloc]init];
    titleLabel1.textColor = RGB0X(0x727272);
    titleLabel1.text = @"商品总额";
    titleLabel1.font = FONT(13);
    [_scrollView addSubview:titleLabel1];
    
    UILabel *contentLabel1 = [[UILabel alloc]init];
    contentLabel1.textColor = RGB0X(0x333333);
    contentLabel1.text = @"¥26.7";
    contentLabel1.font = FONT(13);
    [_scrollView addSubview:contentLabel1];
    
    UIView *line6 = [[UIView alloc]init];
    line6.backgroundColor = RGB0X(0xF8F9F6);
    [_scrollView addSubview:line6];
    
    [line6 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left);
        make.bottom.equalTo(row9.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 0.5/WIDTH_6_SCALE));
    }];
    
    [contentLabel1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.view.mas_right).offset(-15/WIDTH_6_SCALE);
        make.centerY.equalTo(row9.mas_centerY);
    }];
    
    [titleLabel1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(15/WIDTH_6_SCALE);
        make.centerY.equalTo(row9.mas_centerY);
    }];
    
    [row9 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(0);
        make.top.equalTo(row8.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 46/WIDTH_6_SCALE));
    }];

    UIView *row10 = [[UIButton alloc]init];
    row10.backgroundColor = [UIColor whiteColor];
    [_scrollView addSubview:row10];
    
    UILabel *titleLabel2 = [[UILabel alloc]init];
    titleLabel2.textColor = RGB0X(0x727272);
    titleLabel2.text = @"配送费";
    titleLabel2.font = FONT(13);
    [_scrollView addSubview:titleLabel2];
    
    UILabel *contentLabel2 = [[UILabel alloc]init];
    contentLabel2.textColor = RGB0X(0x333333);
    contentLabel2.text = @"¥5";
    contentLabel2.font = FONT(13);
    [_scrollView addSubview:contentLabel2];
    
    UIView *line7 = [[UIView alloc]init];
    line7.backgroundColor = RGB0X(0xF8F9F6);
    [_scrollView addSubview:line7];
    
    [line7 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left);
        make.bottom.equalTo(row10.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 0.5/WIDTH_6_SCALE));
    }];
    
    [contentLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.view.mas_right).offset(-15/WIDTH_6_SCALE);
        make.centerY.equalTo(row10.mas_centerY);
    }];
    
    [titleLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(15/WIDTH_6_SCALE);
        make.centerY.equalTo(row10.mas_centerY);
    }];
    
    [row10 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(0);
        make.top.equalTo(row9.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 46/WIDTH_6_SCALE));
    }];

    UIView *row11 = [[UIButton alloc]init];
    row11.backgroundColor = [UIColor whiteColor];
    [_scrollView addSubview:row11];
    
    UILabel *titleLabel3 = [[UILabel alloc]init];
    titleLabel3.textColor = RGB0X(0x727272);
    titleLabel3.text = @"服务费";
    titleLabel3.font = FONT(13);
    [_scrollView addSubview:titleLabel3];
    
    UILabel *contentLabel3 = [[UILabel alloc]init];
    contentLabel3.textColor = RGB0X(0x333333);
    contentLabel3.text = @"¥0";
    contentLabel3.font = FONT(13);
    [_scrollView addSubview:contentLabel3];
    
    UIView *line8 = [[UIView alloc]init];
    line8.backgroundColor = RGB0X(0xF8F9F6);
    [_scrollView addSubview:line8];
    
    [line8 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left);
        make.bottom.equalTo(row11.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 0.5/WIDTH_6_SCALE));
    }];
    
    [contentLabel3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.view.mas_right).offset(-15/WIDTH_6_SCALE);
        make.centerY.equalTo(row11.mas_centerY);
    }];
    
    [titleLabel3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(15/WIDTH_6_SCALE);
        make.centerY.equalTo(row11.mas_centerY);
    }];
    
    [row11 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(0);
        make.top.equalTo(row8.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 46/WIDTH_6_SCALE));
    }];
    
    UIView *row12 = [[UIButton alloc]init];
    row12.backgroundColor = [UIColor whiteColor];
    [_scrollView addSubview:row12];
    
    UILabel *titleLabel4 = [[UILabel alloc]init];
    titleLabel4.textColor = RGB0X(0x727272);
    titleLabel4.text = @"优惠券";
    titleLabel4.font = FONT(13);
    [_scrollView addSubview:titleLabel4];
    
    UILabel *contentLabel4 = [[UILabel alloc]init];
    contentLabel4.textColor = RGB0X(0xF58000);
    contentLabel4.text = @"-¥0";
    contentLabel4.font = FONT(13);
    [_scrollView addSubview:contentLabel4];
    
    UIView *line9 = [[UIView alloc]init];
    line9.backgroundColor = RGB0X(0xF8F9F6);
    [_scrollView addSubview:line9];
    
    [line9 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(0);
        make.bottom.equalTo(row12.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 0.5/WIDTH_6_SCALE));
    }];
    
    [contentLabel4 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.view.mas_right).offset(-15/WIDTH_6_SCALE);
        make.centerY.equalTo(row12.mas_centerY);
    }];
    
    [titleLabel4 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(15/WIDTH_6_SCALE);
        make.centerY.equalTo(row12.mas_centerY);
    }];
    
    [row12 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(0);
        make.top.equalTo(row11.mas_bottom);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 46/WIDTH_6_SCALE));
    }];
    
    [bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_scrollView.mas_left).offset(0);
        make.top.equalTo(_scrollView.mas_top).offset(0);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 98/WIDTH_6_SCALE));
    }];

    [locationImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(15/WIDTH_6_SCALE);
        make.centerY.equalTo(bgImageView.mas_centerY).offset(0);
        make.size.mas_equalTo(CGSizeMake(20/WIDTH_6_SCALE,24/WIDTH_6_SCALE));
    }];
    
    [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(locationImageView.mas_right).offset(16/WIDTH_6_SCALE);
        make.top.equalTo(bgImageView.mas_top).offset(27/WIDTH_6_SCALE);
    }];
    
    [locationLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(nameLabel.mas_left).offset(0);
        make.top.equalTo(nameLabel.mas_bottom).offset(12/WIDTH_6_SCALE);
    }];
    [boxImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(15/WIDTH_6_SCALE);
        make.top.equalTo(bgImageView.mas_bottom).offset(15/WIDTH_6_SCALE);
        make.size.mas_equalTo(CGSizeMake(18/WIDTH_6_SCALE, 18/WIDTH_6_SCALE));
    }];
    [tipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(boxImageView.mas_right).offset(15/WIDTH_6_SCALE);
        make.top.equalTo(bgImageView.mas_bottom).offset(18/WIDTH_6_SCALE);
    }];
    
    UIView *section5 = [[UIView alloc]init];
    section5.backgroundColor = RGB0X(0xF8F9F6);
    [_scrollView addSubview:section5];
    
    [section5 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.mas_left).offset(0);
        make.top.equalTo(row12.mas_bottom).offset(0);
        make.size.mas_equalTo(CGSizeMake(WIDTH, 57/WIDTH_6_SCALE));
    }];
    
    [self.view layoutIfNeeded];
    _scrollView.contentSize=CGSizeMake(self.view.frame.size.width,1000);
    

//    [_scrollView setShowsVerticalScrollIndicator:NO];
    _scrollView.scrollEnabled = YES;
}

//- (void)createTableView{
//    _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, WIDTH, HIGHT-64) style:UITableViewStylePlain];
//    _tableView.tableHeaderView = _headView;
//    _tableView.delegate = self;
//    _tableView.dataSource = self;
//    [self.view addSubview:_tableView];
//}
//
//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
//    return 16;
//}
//
//- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
//    NSString *CellIdentifier = SF(@"%ld",indexPath.row);
//    if (indexPath.row == 2) {
//        ImageTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
//        if (cell == nil) {
//            cell = [[ImageTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
//            return cell;
//        }
//    }else{
//        EnsureTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
//        if (cell == nil) {
//            cell = [[EnsureTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
//            cell.model = self.dataArray[indexPath.row];
//            return cell;
//        }
//    }
//    return nil;
//}

- (void)row2Click{
    
}

- (void)onlineButtonClick:(UIButton *)sender{
    
}

- (void)row6Click{
    
}

- (void)row8Click{
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
